<!--
    -  Copyright (c) 2018-2025, haohanwork.com All rights reserved.
  -->
<template>
  <div class="execution">
    <basic-container>
      <avue-crud ref="crud"
                 :page.sync="page"
                 :data="tableData"
                 :permission="permissionList"
                 :table-loading="tableLoading"
                 :option="tableOption"
                 @on-load="getList"
                 @search-change="searchChange"
                 @refresh-change="refreshChange"
      >
        <template slot-scope="scope" slot="menu">
          <el-button type="primary"
                     size="small"
                     @click="jumpToDetail(scope.row)">详情
          </el-button>
          <el-button type="primary"
                     size="small">打印
          </el-button>
          <el-button type="primary"
                     size="small">查看凭证
          </el-button>
        </template>
      </avue-crud>
    </basic-container>
  </div>
</template>
<!-- 采购退货 -->
<script>
  import {
    fetchList,
    getObj
  } from '@/api/scm/client/customerstatistics'
  import {
    tableOption
  } from '@/const/crud/scm/client/customerstatistics'
  import {
    mapGetters
  } from 'vuex'
  import {
    getDictList
  } from '@/api/admin/dict'
  import Util from '@/util/pds/utils'
  let cookieUtil = new Util();

  export default {
    name: 'order',
    data() {
      return {
        tableData: [],
        page: {
          total: 0, // 总页数
          currentPage: 1, // 当前页数
          pageSize: 20 // 每页显示多少条
        },
        tableLoading: false,
        tableOption: tableOption
      }
    },
    computed: {
      ...mapGetters(['permissions']),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permissions.purchase_purchasetask_add, true),
          delBtn: this.vaildData(this.permissions.purchase_purchasetask_del, true),
          editBtn: this.vaildData(this.permissions.purchase_purchasetask_edit, true)
        };
      }
    },
    methods: {
      getList(page, params={}) {
        /*this.tableLoading = true
        params.pmId = cookieUtil.getCookie("pmId");
        params.current = page.currentPage;
        params.size = page.pageSize;
        fetchList(params).then(response => {
          this.tableData = response.data.data.records
          this.page.total = response.data.data.total
          this.tableLoading = false
        })*/
        this.tableData=[1]
      },
      /**
       * 搜索回调
       */
      searchChange(form, done) {
          this.getList(this.page, form);
          done();
      },
      /**
       * 刷新回调
       */
      refreshChange(info) {
    this.getList(this.page, this.filterForm(info.searchForm));
},
      /**
       * 页面跳转 新增采购计划
       */
      jumpToDetail(row) {
        this.$router.push({path: '/customerstatistics/detail', query:{row:row}})
      }
    }
  }
</script>

<style lang="scss" scoped>
</style>
